{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import pdb\n",
    "\n",
    "data = pd.read_csv(\"company.csv\", encoding='ANSI')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>平均每次消费金额</th>\n",
       "      <th>平均消费周期（天）</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>317</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>147</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>172</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>194</td>\n",
       "      <td>67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>789</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>190</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>281</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>142</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>186</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>226</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>287</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>499</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>181</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>172</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>190</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>271</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>382</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>290</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>200</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>13</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>60</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>26</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    平均每次消费金额  平均消费周期（天）\n",
       "0        317         10\n",
       "1        147         13\n",
       "2        172         17\n",
       "3        194         67\n",
       "4        789         35\n",
       "5        190          1\n",
       "6        281         10\n",
       "7        142         12\n",
       "8        186          8\n",
       "9        226          1\n",
       "10       287         32\n",
       "11       499          3\n",
       "12       181         90\n",
       "13       172          1\n",
       "14       190         16\n",
       "15       271         31\n",
       "16       382         25\n",
       "17       290          1\n",
       "18       200         10\n",
       "19        13         12\n",
       "20        60          8\n",
       "21        26          1"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 将超市客户分3组：普通用户、vip、SVIP\n",
    "\n",
    "# 1. 筛选特征值【不是所有的特征都 有助于 结果分组】\n",
    "train_X = data[[\"平均每次消费金额\", \"平均消费周期（天）\"]]\n",
    "train_X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def k_means(center):\n",
    "    # print(train_X)\n",
    "    # train_X.values 数据部分--是二维数组；遍历即获得每行的数据\n",
    "    label = []\n",
    "    for sample in train_X[[\"平均每次消费金额\", \"平均消费周期（天）\"]].values:\n",
    "        # print(sample)\n",
    "        # pdb.set_trace()\n",
    "        dis = np.sqrt(((sample - center) ** 2).sum(axis=1))\n",
    "\n",
    "        # 第一个样本的：[304.13319451 478.73165761 267.18720029]\n",
    "        # 表明 第一个样本 属于类2\n",
    "        # 找最小值所在的索引\n",
    "        # print(\"距离\", dis, \"类别\", dis.argmin())\n",
    "        label.append(dis.argmin())\n",
    "        # break\n",
    "\n",
    "    train_X[\"组号\"] = label\n",
    "    # print(\"第一次聚类后\\n\", train_X)\n",
    "\n",
    "    new_center = train_X.groupby(by=\"组号\").mean()\n",
    "\n",
    "    return new_center"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 随机初始化聚类中心\n",
    "center = np.array([[13, 1],\n",
    "                   [789, 90],\n",
    "                   [50, 20],\n",
    "                   [60,100]\n",
    "                 ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "聚类一共进行了 3 次\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>平均每次消费金额</th>\n",
       "      <th>平均消费周期（天）</th>\n",
       "      <th>组号</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>317</td>\n",
       "      <td>10</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>147</td>\n",
       "      <td>13</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>172</td>\n",
       "      <td>17</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>194</td>\n",
       "      <td>67</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>789</td>\n",
       "      <td>35</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>190</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>281</td>\n",
       "      <td>10</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>142</td>\n",
       "      <td>12</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>186</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>226</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>287</td>\n",
       "      <td>32</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>499</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>181</td>\n",
       "      <td>90</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>172</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>190</td>\n",
       "      <td>16</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>271</td>\n",
       "      <td>31</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>382</td>\n",
       "      <td>25</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>290</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>200</td>\n",
       "      <td>10</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>13</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>60</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>26</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    平均每次消费金额  平均消费周期（天）  组号\n",
       "0        317         10   3\n",
       "1        147         13   2\n",
       "2        172         17   2\n",
       "3        194         67   2\n",
       "4        789         35   1\n",
       "5        190          1   2\n",
       "6        281         10   3\n",
       "7        142         12   2\n",
       "8        186          8   2\n",
       "9        226          1   2\n",
       "10       287         32   3\n",
       "11       499          3   1\n",
       "12       181         90   2\n",
       "13       172          1   2\n",
       "14       190         16   2\n",
       "15       271         31   3\n",
       "16       382         25   3\n",
       "17       290          1   3\n",
       "18       200         10   2\n",
       "19        13         12   0\n",
       "20        60          8   0\n",
       "21        26          1   0"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "timer = 0  # 记录次数\n",
    "while True:\n",
    "    timer += 1\n",
    "    new_center = k_means(center)\n",
    "    # pdb.set_trace()\n",
    "    if np.all(center == new_center.values):\n",
    "        break\n",
    "\n",
    "    else:\n",
    "        # 如果新旧聚类中心不一致；\n",
    "        # 新的聚类中心  赋值  为旧的聚类中心\n",
    "        center = new_center\n",
    "\n",
    "print(\"聚类一共进行了\", timer, \"次\")\n",
    "train_X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def show_result(train_data):\n",
    "    make_list = [\"o\",\"*\",\"d\",\"r\"]\n",
    "    for i in range(3):\n",
    "        part_data = train_data.loc[train_data[\"组号\"]==i,[\"平均每次消费金额\", \"平均消费周期（天）\"]]\n",
    "        x_data = part_data[\"平均每次消费金额\"]\n",
    "        y_data = part_data[\"平均消费周期（天）\"]\n",
    "        plt.scatter(x_data, y_data, marker = make_list[i])\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAUc0lEQVR4nO3db2xV933H8fcXmxaHrCVggyiNBpmitNH+hARlbYmqNhlLYVMTVZmURJ1YlSl7sJB2mzpBiTZNQmq2TtOmZJoUNdvQWpg6mn/qyBJE1wfpg242pGsYoWxJl4ZQYzOl3SJnxfDdg3toDDH29fW995xz/X5J1rnn+PqeD2B/OD73nN8vMhNJUv0sKjuAJKk1Frgk1ZQFLkk1ZYFLUk1Z4JJUU/3d3Nng4GCuXbu2m7uUpNobGRkZz8yhi7d3tcDXrl3L8PBwN3cpSbUXEf813XZPoUhSTVngklRTFrgk1ZQFXjOjb4yWHUFSRVjgNTIyOsKmfZs4NHqo7CiSKsACr4nJc5M88NwDJMnO53YyeW6y7EiSSmaB18Seo3s4/eZpAE6/eZq9L+4tOZGkslngNTA+Mc7Dzz/MxOQEABOTEzx0+CHGJ8ZLTiapTBZ4Dex/aT9nz529YNvZPMvTLz9dUiJJVWCB18CWq7bQt6jvgm190cfmdZtLSiSpCizwGhgcGOS+6+5joH8AgIH+Abat38bgwGDJySSVyQKvibvffzcrlqwAYHDJIHe9766SE0kqmwVeE/2L+tl10y6CYNdNu+hf1NVxyCRVkC1QIzesuoEDdxxg1dJVZUeRVAEegdeM5S3pPAtckmrKApekmrLAJammLHBJqikLXJJqygKXpJqywCWppixwSaopC1ySasoCl6SassAlqaYscEmqqaYKPCJ+JyKORMQLEbE3IpZExPKIOBARx4vlFZ0OK0l6y6wFHhFrgPuBDZn5s0AfcCewHTiYmVcDB4t1SVKX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fs8Lj1bZp4A/hR4BTgJ/DAzn213tqoVeFPTtFVIKXkj4nLgq8BnMvNHMz11mm0dy5eZZzPzOhpHuzdGxM/O8PSuZYuIXwVOZeZIs18yzbZO/rtuzMzrgc3Ab0fEh2d4brez9dM4pfhXmbkeeIPGr/6X0vWfiYh4B/Bx4B9me+o02zr1PXcFjUne1wHvAZZGxCfbna1qBV7aNG2zGI2I1QDF8lSxvet5I2IxjfL+cmY+VrV8AJn5OvAN4GMVybYR+HhEfA/4e+DmiPhSRbKRma8Vy1PA48CNVclW7O/V4rcpgH00Cr0q+aDxH9+hzBwt1quQ7ZeAlzNzLDPPAI8BH2p3tqoV+L8CV0fEuuJ/1TuBp0rOBI0MW4vHW2mcez6//c6IeGdErAOuBv6lUyEiIoBHgaOZ+WdVyhcRQxGxrHg8QOMb+MUqZMvMHZn53sxcS+N76uuZ+ckqZIuIpRHxU+cf0zhP+kIVsgFk5g+A70fENcWmW4B/r0q+wl28dfrkfIays70CfCAiLit+bm8BjrY9W6ffXGjh5P8WGldX/Cews4T976VxzuoMjf8V7wFW0HgD7HixXD7l+TuLrMeAzR3OdhONX6v+DXi++NhShXzAzwOHi2wvAH9QbC8920U5P8Jbb2KWno3GOeZvFx9Hzn/PVyHblP1dBwwX/7ZPAFdUJR+NN8xPA++esq0q2f6IxkHMC8Df0bjCpK3ZvJVekmqqaqdQJElNssAlqaYscEmqKQtckmrKApekmrLAJammLHBJqqn/B+0GW7X1Y5NVAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_result(train_X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
